home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Archives / Replacements / cpdist_0_17.lha / cpdist-0.17 / source / cpdist.h < prev    next >
C/C++ Source or Header  |  1995-03-03  |  3KB  |  111 lines

  1. /*
  2.  *  CPDIST.H
  3.  */
  4.  
  5. /*
  6.  * (c)Copyright 1992-93 by Tobias Ferber.
  7.  *
  8.  * This file is part of CPDIST.
  9.  *
  10.  * CPDIST is free software; you can redistribute it and/or modify
  11.  * it under the terms of the GNU General Public License as published
  12.  * by the Free Software Foundation; either version 1 of the License,
  13.  * or (at your option) any later version.
  14.  *
  15.  * CPDIST is distributed in the hope that it will be useful,
  16.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18.  * GNU General Public License for more details.
  19.  *
  20.  * You should have received a copy of the GNU General Public License
  21.  * along with CPDIST; see the file COPYING.  If not, write to
  22.  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  23.  */
  24.  
  25. #ifndef CPDIST_H
  26. #define CPDIST_H
  27.  
  28. #include <ctype.h>
  29. #include <stdarg.h>
  30. #include <stdio.h>
  31.  
  32. #include "version.h"
  33.  
  34. /* Please feel free to compile with the -DNO_PERROR */
  35. #ifdef NO_PERROR
  36. #define perror(s) do { printf("%s: I/O error detected.\n",s); } while(0)
  37. #endif /* NO_PERROR */
  38.  
  39. #ifdef __MSDOS__
  40. #define PSLASH            '\\'
  41. #else /* !__MSDOS__ */
  42. #define PSLASH            '/'
  43. #endif /* __MSDOS__ */
  44.  
  45. /* Please do not change the option prefix.  This is not supported (yet) */
  46. #define OPTION_PREFIX     '-'
  47. #define DEFAULT_DISTFILE  "Distfile"
  48.  
  49. #define MAXIMUM_PATHNAME_LENGTH 256
  50.  
  51. /* options */
  52. #define OPT_REPLACEALL   (1)     /* don't ask before blowing it away */
  53. #define OPT_CHECKEXISTS  (1<<1)  /* check existence of source files */
  54. #define OPT_IGNOREERRORS (1<<2)  /* ignore syntax errors in distfiles */
  55. #define OPT_KEEPGOING    (1<<3)  /* keep going in case of I/O errors */
  56. #define OPT_DRYRUN       (1<<4)  /* just print, don't copy */
  57. #define OPT_SILENT       (1<<5)  /* don't print filenames when copying */
  58.  
  59. #define CP_REPLACEALL    ((global_opts & OPT_REPLACEALL) == OPT_REPLACEALL)
  60. #define CP_CHECKEXISTS   ((global_opts & OPT_CHECKEXISTS) == OPT_CHECKEXISTS)
  61. #define CP_IGNOREERRORS  ((global_opts & OPT_IGNOREERRORS) == OPT_IGNOREERRORS)
  62. #define CP_KEEPGOING     ((global_opts & OPT_KEEPGOING) == OPT_KEEPGOING)
  63. #define CP_DRYRUN        ((global_opts & OPT_DRYRUN) == OPT_DRYRUN)
  64. #define CP_SILENT        ((global_opts & OPT_SILENT) == OPT_SILENT)
  65.  
  66.  
  67. /* prototypes */
  68.  
  69. #if defined(__cplusplus) || defined(cplusplus)
  70. extern "C" {
  71. #endif
  72.  
  73. #ifndef __P
  74.  
  75. #if defined (__STDC__) || defined(__cplusplus)
  76. #define __P(protos) protos
  77. #else /* !(__STDC__ || __cplusplus) */
  78. #define __P(protos) ()
  79. #endif /* __STDC__ || __cplusplus */
  80.  
  81. #endif /* !__P */
  82.  
  83. /* main.c */
  84. extern unsigned long global_opts;  /* command-line options */
  85. extern long global_buffersize;     /* size of our copy buffer */
  86.  
  87. /* msg.c */
  88. extern FILE *ferr;
  89. extern char *whoami;
  90. extern void echo __P( (const char *, ...) );
  91. extern void lerror __P( (int, const char *, ...) );
  92.  
  93. /* args.c */
  94. extern char *convert_args __P( (char *) );
  95. extern void display_args __P( (void) );
  96.  
  97. /* cpdist.c */
  98. extern int prepare_distribution __P( (char *, char *) );
  99.  
  100. /* keys.c */
  101. extern int ln_addnode __P( (char *) );
  102. extern int ln_member __P( (char *) );
  103. extern void ln_purge __P( (void) );
  104.  
  105. #if defined(__cplusplus) || defined(cplusplus)
  106. }
  107. #endif /* C++ */
  108.  
  109. #endif /* !CPDIST_H */
  110.  
  111.